package com.wx.springboot.step6.es.repository;

import com.wx.springboot.step6.es.document.EsProduct;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.annotations.Query;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;

import java.util.List;

/**
 * 商品ES操作类
 */
public interface EsProductRepository extends ElasticsearchRepository<EsProduct, Long> {

    /**
     * 根据名称搜索
     * @param name
     * @return
     */
    List<EsProduct> findByName(String name);

    /**
     *
     * @param name
     * @param keywords
     * @param subTitle
     * @return
     */
    List<EsProduct> getByNameOrKeywordsOrSubTitle(String name,String keywords,String subTitle);
}
